{include file="public/head"/}
{include file="public/left"/}
<div class="main-content">
<div class="main-content-inner">
{include file="public/nav_head"/}
<div class="row" style="margin:15px 0 0 0">
	<form class="form-horizontal" method="post" id="form" action="{:url('editHandle')}">
	<input type="hidden" name="id" value="{$arc.id}">
    <input type="hidden" name="cid" value="{$cid}">
	<input type="hidden" name="id" value="{$arc.id}">
		<div class="col-xs-12 col-sm-12 col-md-7" id="myleft">
			<div class="panel panel-default">
		  		<div class="panel-heading">基本信息</div>
				<div class="panel-body" style="position:relative">
		            <div class="form-group">
		                <label class="col-sm-1 control-label no-padding-right"> <b class="red">* </b>栏目 </label>
		                <div class="col-sm-11">
		                    <select class="form-control" id="navid" name="navid">
		                        <option value="0">请选择栏目</option>
		                        {foreach name="navlevel" item="nav"}
		                        <option value="{$nav.id}" {if condition="$nav['cid'] NEQ $cid"}disabled{/if} class="bgccc" {if condition="$nav['id'] EQ $navself['id']"}selected{/if}>
		                        {if condition="$nav['level'] EQ 0"}{$nav.navname}{/if}
		                        {if condition="$nav['level'] EQ 1"}　 {$nav.navname}{/if}
		                        {if condition="$nav['level'] EQ 2"}　　 {$nav.navname}{/if}
		                        {if condition="$nav['level'] EQ 3"}　　　 {$nav.navname}{/if}
		                        </option>
		                        {/foreach}
		                    </select>
		                </div>
		            </div>
		            <div class="form-group">
		                <label class="col-sm-1 control-label no-padding-right"> <b class="red">* </b>名称 </label>
		                <div class="col-sm-5">
		                    <input type="text" name="title" id="title" class="col-xs-12 col-sm-12" value="{$arc.title}" />
		                </div>
		                <label class="col-sm-1 control-label no-padding-right"> <b class="red">* </b>部门 </label>
		                <div class="col-sm-5">
		                    <input type="text" name="department" id="department" class="col-xs-12 col-sm-12" value="{$arc.department}" />
		                </div>
		            </div>
		            <div class="form-group">
		                <label class="col-sm-1 control-label no-padding-right"> <b class="red">* </b>地点 </label>
		                <div class="col-sm-5">
		                    <input type="text" name="address" id="address" class="col-xs-12 col-sm-12" value="{$arc.address}" />
		                </div>
		                <label class="col-sm-1 control-label no-padding-right"> <b class="red">* </b>年龄 </label>
		                <div class="col-sm-5" style="position: relative;">
		                    <input type="text" name="age" id="age" class="col-xs-12 col-sm-12 center" value="{$arc.age}" />
		                    <span style="position: absolute; right:20px; top:8px">岁</span>
		                </div>
		            </div>
		            <div class="form-group">
		                <label class="col-sm-1 control-label no-padding-right"> 人数 </label>
		                <div class="col-sm-5" style="position: relative;">
		                    <input type="text" name="number" class="col-xs-12 col-sm-12 center" value="{$arc.number}" />
		                    <span style="position: absolute; right:20px; top:8px">人</span>
		                </div>
		                <label class="col-sm-1 control-label no-padding-right"> 学历 </label>
		                <div class="col-sm-5">
		                    <select class="form-control" id="degree" name="degree">
		                    	{foreach name="degree" item="vo" key="k"}
		                        <option value="degree{$k}" {if condition="$arc['degree'] EQ 'degree'.$k"}selected{/if}>{$vo}</option>
		                        {/foreach}
		                    </select>
		                </div>
		            </div>
		            <div class="form-group">
		                <label class="col-sm-1 control-label no-padding-right"> 经验 </label>
		                <div class="col-sm-5">
		                    <select class="form-control" id="experience" name="experience">
		                        {foreach name="experience" item="vo" key="k"}
		                        <option value="experience{$k}" {if condition="$arc['experience'] EQ 'experience'.$k"}selected{/if}>{$vo}</option>
		                        {/foreach}
		                    </select>
		                </div>
		                <label class="col-sm-1 control-label no-padding-right"> 待遇 </label>
		                <div class="col-sm-5">
		                    <select class="form-control" id="treatment" name="treatment">
		                        {foreach name="treatment" item="vo" key="k"}
		                        <option value="treatment{$k}" {if condition="$arc['treatment'] EQ 'treatment'.$k"}selected{/if}>{$vo}</option>
		                        {/foreach}
		                    </select>
		                </div>
		            </div>
		            <div class="form-group">
		                <label class="col-sm-1 control-label no-padding-right"> 性质 </label>
		                <div class="col-sm-5">
		                    <select class="form-control" id="nature" name="nature">
		                        <option value="全职" class="bgccc" {if condition="$arc['nature'] EQ '全职'"}selected{/if}>全职</option>
		                        <option value="兼职" class="bgccc" {if condition="$arc['nature'] EQ '兼职'"}selected{/if}>兼职</option>
		                        <option value="实习" class="bgccc" {if condition="$arc['nature'] EQ '实习'"}selected{/if}>实习</option>
		                    </select>
		                </div>
		                <label class="col-sm-1 control-label no-padding-right"> 性别 </label>
		                <div class="col-sm-5">
		                    <select class="form-control" id="sex" name="sex">
		                        <option value="男" class="bgccc" {if condition="$arc['sex'] EQ '男'"}selected{/if}>男</option>
		                        <option value="女" class="bgccc" {if condition="$arc['sex'] EQ '女'"}selected{/if}>女</option>
		                        <option value="不限" class="bgccc" {if condition="$arc['sex'] EQ '不限'"}selected{/if}>不限</option>
		                    </select>
		                </div>
		            </div>
		            <div class="form-group">
		                <label class="col-sm-1 control-label no-padding-right"> 时间 </label>
		                <div class="col-sm-5">
		                    <input type="text" name="savedate" class="col-xs-12 col-sm-12" value="{$arc.savedate|date='Y-m-d H:i',###}" id="savedate" />
		                </div>
		                <label class="col-sm-1 control-label no-padding-right"> 截止 </label>
		                <div class="col-sm-5">
		                    <input type="text" name="overdue" class="col-xs-12 col-sm-12" value="{$arc.overdue|date='Y-m-d H:i',###}" id="overdue" />
		                </div>
		            </div>
		            </div>
				<div class="panel-footer text-center">
					<button class="ky_btn btn_blue" type="submit" style="padding:10px 25px">
				        <i class="ace-icon fa fa-check bigger-110"></i>保存
				    </button>
				</div>
			</div>
		</div>
            
		<div class="col-xs-12 col-sm-5">
			<div class="alert alert-block alert-success" style="margin-bottom:0">
				<i class="ace-icon fa fa-check green"></i>
				职位描述：尽可能的将职位要求、福利待遇等情况描述完整
			</div>
			<div class="form-group">
				<div class="col-sm-12">
					<textarea name="body" id="body" class="col-xs-12 col-sm-12 pdno">{$arc.body}</textarea>
		            <script type="text/javascript">var ue = UE.getEditor('body');</script>
				</div>
			</div> 
		</div>
	</form>
</div>

</div>
</div>
{include file="public/foot"/}
<script type="text/javascript">
     $('#form').ajaxForm({
        beforeSubmit : editcheck,
        success : complete,
        dataType : 'json'
    });
    function editcheck(){
        if($('#navid').val()==0){
            layer.tips('栏目必选','#navid',3);
            $('#navid').focus();
            return false;
        }
        if($('#title').val()==''){
            layer.tips('标题必填','#title',3);
            $('#title').focus();
            return false;
        }
        if($('#department').val()==''){
            layer.tips('部门必填','#department',3);
            $('#department').focus();
            return false;
        }
        if($('#address').val()==''){
            layer.tips('地点必填','#address',3);
            $('#address').focus();
            return false;
        }
    }
    function complete(data){
        if(data.status==0){
            layer.msg(data.msg,{icon:5});
        }
        if(data.status==1){
            layer.msg(data.msg,{icon:6},function(){
                window.location.href=data.url;
            });
        }
    }
</script>

  <script src="_PLUG_/datetimepicker/jquery.datetimepicker.js"></script>
  <link rel="stylesheet" href="_PLUG_/datetimepicker/jquery.datetimepicker.css">
        <script>
        $('#savedate').datetimepicker({
            format:"Y-m-d H:i",      //格式化日期
            lang:"ch",           //语言选择中文
            timepicker:false
        });
        $('#overdue').datetimepicker({
            format:"Y-m-d H:i",      //格式化日期
            lang:"ch",           //语言选择中文
            timepicker:false
        });
        var ageold = $('#age').val();
        $('#age').focus(function(){
            $(this).val('');
        });
        $('#age').blur(function(){
            if($(this).val()==''){
                $(this).val(ageold);
            }
        });
        </script>
